// vite.config.js
import {
  defineConfig,
  loadEnv
} from "file:///D:/work/project/tf-pc-carpool/node_modules/.store/vite@4.5.3/node_modules/vite/dist/node/index.js";
import vue from "file:///D:/work/project/tf-pc-carpool/node_modules/.store/@vitejs+plugin-vue@4.6.2/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import {
  createSvgIconsPlugin
} from "file:///D:/work/project/tf-pc-carpool/node_modules/.store/vite-plugin-svg-icons@2.0.1/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import path from "path";
var vite_config_default = defineConfig(({
  mode
}) => {
  let env = loadEnv(mode, process.cwd());
  return {
    plugins: [
      vue(),
      createSvgIconsPlugin({
        iconDirs: [path.resolve(process.cwd(), "src/assets/icons")],
        symbolId: "icon-[dir]-[name]"
      })
    ],
    resolve: {
      alias: {
        "@": path.resolve("./src")
        // 相对路径别名配置，使用 @ 代替 src
      }
    },
    css: {
      preprocessorOptions: {
        scss: {
          javascriptEnabled: true,
          additionalData: '@import "./src/styles/variable.scss";'
        }
      }
    },
    // 代理跨域
    server: {
      proxy: {
        [env.VITE_APP_BASE_API]: {
          // 获取数据的服务器地址
          target: env.VITE_SERVE,
          // 是否需要代理跨域
          changeOrigin: true,
          // 路径重写把api换成空（如果地址带有api则不需要，没有则需要如：/admin/acl/user/batchRemove需要）
          rewrite: (path2) => path2.replace(/^\/api/, "")
          // 此配置可以查看真实请求信息，生产请注释
          // bypass(req, res, options) {
          //   console.log('真实请求信息');
          //   console.log(req, res, options);
          //   const proxyUrl = new URL(options.rewrite(req.url) || '', (options.target))?.href || '';
          //   console.log(proxyUrl);
          //   req.headers["x-req-proxyUrl"] = proxyUrl; //设置无效
          //   res.setHeader("x-res-proxyUrl", proxyUrl); //有效
          // }
        }
      }
    },
    build: {
      outDir: "kcbservice-admin"
      // 打包文件的输出目录
    },
    base: mode === "development" ? "/" : "/kcbservice-admin/"
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywK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